<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
	xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
      >

<head>

</head>
<body>
<ui:composition template="/templates/template.xhtml">
	

	<ui:define name="contenu">
	
		<f:view>
		<br/><br/><br/><br/>
			<div style="border:1px solid purple; border-radius:1px; width:550px; ">
	
				<table width="550px" align="right" border="0">
					<th width="200px"></th> <th width="100px" align="center">Prix unitaire</th> <th width="80px" align="center">quantité</th><th></th>
				</table>
				<br/>
			    <h:dataTable value="#{controllerBeanJsf.cartTickets}" var="cartTicket" border="0"  width="550px">

					<h:column>						
						<h:outputText value="#{cartTicket.ticket.name}" />	
					</h:column>
					<h:column>						
						<h:outputText value="#{cartTicket.ticket.price}" /> $	
					</h:column>
					<h:column>	
						<h:outputText value="#{cartTicket.quantity}" />	
					</h:column>
					
					<h:column>
					<h:form >
						<center><h:commandButton value="Supprimer" 
		    			style="background:purple; color:white;border: 2px solid grey;border-radius:5px; height:30px"
		    			action="#{controllerBeanJsf.removeTicket}"/>
		    			</center>
		    			
		    			</h:form>
					</h:column>

				</h:dataTable>
				<hr />
				<table width="550px">
					<tr>
						<td align="left"><b>PRIX TOTAL (TTC):</b></td>
						<td align="center"><b><h:outputText value="#{controllerBeanJsf.getTotalPrice}" /> $</b></td>
					</tr>
				</table>

				<br/>
	
			 </div>
			 <br/><br/><br/><br/>
			 <h:form >
			 <h:commandButton value="Continue Shopping" 
				style="background:purple; color:white;border: 2px solid grey;border-radius:5px; height:30px"
				action="#{controllerBeanJsf.continueShopping}" />
				<h:commandButton value="Validate Caddy" 
				style="background:purple; color:white;border: 2px solid grey;border-radius:5px; height:30px"
				action="#{controllerBeanJsf.validCard}" />
	        </h:form>
	       
	        
		</f:view>
	</ui:define>
	
</ui:composition>
</body>
</html>